package com.lxh.simplefactory;

public class OperationFactory {
    public static Operation createOperation(String operation) {
        Operation o = null;
        switch (operation) {
            case "+":
                o = new OperationAdd();
                break;
            case "-":
                o = new OperationSub();
                break;
            case "*":
                o = new OperationMul();
                break;
            case "/":
                o = new OperationDiv();
                break;
        }
        return o;
    }
}
